<!-- 所有视图的头部 -->
<?php include 'inc/widget_head.php';?>

<!-- 默认主题 样式表 -->
<link href="/statics/css/default.css" media="all" rel="stylesheet"/>

<style type="text/css">
body{
    background: url(/statics/imgs/bg/5.jpg);
    background-position: 0 -20px;
    background-size: cover;
}
</style>

<center>

<div class="layui-container">

    <div class="layui-row layui-form layui-form-pane">
        <div style="height: 100px">&nbsp;</div>
        <div style="margin:30px auto;">
            <i class="layui-badge-dot layui-bg-orange"></i>&nbsp;
             <a href='login'style='color:#fff;'>教师登录</a> &nbsp; &nbsp;
             <i class="layui-badge-dot layui-bg-orange"></i>&nbsp;
             <a href='/'style='color:#fff;'>系统首页</a>
        </div>

        <div class="layui-col-md12" style="color:white">
        <?php if(GS('setup')['allow_register']==='0'){?>
        <h1>
        <i class="layui-badge-dot"></i>&nbsp; 注册关闭中, 如需注册, 请联系老师!  座位号: <?=getSite()?>
        </h1>
        <?php }else{?>

            <?php if(empty(GS('student'))){?>
                <div>

                    &nbsp; 班级: <?=$this->bjName?>班 &nbsp;



                    <input type="text" name="name" class="layui-input regName"
                        autocomplete="off" placeholder="在此输入姓名"
                     lay-verify="required" maxlength='4' />
                    <button class="layui-btn layui-btn-normal regButton"
                        lay-filter="do" lay-submit>注 册</button>

            <?php }else{?>
                    <h1><?=GS('student')['name']?>, 你已注册,若姓名有误,请联系老师! </h1>
            <?php }?>
                </div>
        <?php }?>
        </div>
    </div>
</div>

</center>

    <script language="javascript">
        layui.use(['form', 'element'], function () {
            var form = layui.form
                , $ = layui.$;

            $('.layui-nav').hide();
            $('.footer').hide();
            $('.layui-container').show();


            form.on('submit(do)', function () {
                let data={name:$('input[name="name"]').val()};
                $.post('/index/register', data, function (r) {
                    layer.msg(r,function(){
                        location.assign('/index/index');//输入姓名成功后,跳转到首页
                    });
                });
                return false;
            });


        });
    </script>




            </div>
        </div>

        <div class="footer" style="text-align: center">
               <!--   THE SYSTEM WAS DEVELOPED BY YJH FROM 2008 TO 2022.
                <b><?=GS('setup')['realname']?></b>
                teaching now. -->
        </div>

    </body>
</html>

<!-- 加入闪现消息小插件 -->
<?php include 'inc/widget_flashMsg.php';?>
